<!DOCTYPE html>
<html>
<head>
<title>管理员列表</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="plugins/jqgrid/ui.jqgrid-bootstrap.css">
<link rel="stylesheet" href="plugins/ztree/css/zTreeStyle/zTreeStyle.css">
<link rel="stylesheet" href="css/main.css">
<script src="libs/jquery.min.js"></script>
<script src="plugins/layer/layer.js"></script>
<script src="libs/bootstrap.min.js"></script>
<script src="libs/vue.min.js"></script>
<script src="plugins/jqgrid/grid.locale-cn.js"></script>
<script src="plugins/jqgrid/jquery.jqGrid.min.js"></script>
<script src="plugins/ztree/jquery.ztree.all.min.js"></script>
<script src="js/common.js"></script>
</head>
<body>
<div id="rapp" v-cloak>
	<div v-show="showList">
		<div class="grid-btn">
			<div class="form-group col-sm-2">
				<input type="text" class="form-control" v-model="q.keyword" v-on:keyup.enter="query" placeholder="输入标题进行搜索">
			</div>
			<a class="btn btn-default" v-on:click="query"><i class="fa fa-search">&nbsp;查询</i></a>
			<a class="btn btn-primary" v-on:click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
		</div>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>
    
    <div v-show="!showList" class="panel panel-default">
		<div class="panel-heading">{{title}}</div>
		<form class="form-horizontal">
			<div class="form-group">
			   	<div class="col-sm-2 control-label">标题</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="info.title" placeholder="标题" />
			    </div>
			</div>
			
		<!-- 	<div class="form-group">
				<div class="col-sm-2 control-label">子标题</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="info.subTitle" placeholder="子标题"/>
				</div>
			</div> -->
			 <!-- <div class="form-group">
				<div class="col-sm-2 control-label">分类</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" style="cursor:pointer;" v-model="info.category.name" @click="menuTree('category')" readonly="readonly" placeholder="分类"/>
				</div>
			</div> -->
			<div class="form-group">
				<div class="col-sm-2 control-label">分类</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" style="cursor:pointer;" v-model="info.secondCategory.name" @click="menuTree('secondCategory')"  readonly="readonly" placeholder="分类"/>
				</div>
			</div> 
			<!-- <div class="form-group">
			   	<div class="col-sm-2 control-label">简介</div>
			   	<div class="col-sm-10">
			   		<textarea rows="3" class="form-control" v-model="info.intro" placeholder="简介"></textarea>
			    </div>
			</div> -->
			<!-- <div class="form-group">
				<div class="col-sm-2 control-label">封面图片</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="info.coverImagePath" placeholder="封面图片"/>
				</div>
			</div> -->
			<div class="form-group">
				<div class="col-sm-2 control-label">首页显示</div> 
				<label class="radio-inline">
				  <input type="radio" name="indexDisplayFlag" value="1" v-model="info.indexDisplayFlag" />显示
				</label>
				<label class="radio-inline">
				  <input type="radio" name="indexDisplayFlag" value="0" v-model="info.indexDisplayFlag"/>不显示
				</label>
			</div>
			<div class="form-group">
				<div class="col-sm-2 control-label">状态</div> 
				<label class="radio-inline">
				  <input type="radio" name="stateType" value="1" v-model="info.stateType"/>可用
				</label>
				<label class="radio-inline">
				  <input type="radio" name="stateType" value="0" v-model="info.stateType"/>禁用
				</label>
			</div>
			
			<div class="panel panel-info" v-for="(infoDetail, index) in info.infoDetailList"  style="margin-left: 50px;">
			    <div class="panel-heading">
			        <h3 class="panel-title">段落 {{index+1}}</h3>
			    </div>
			    <div class="panel-body">
				    <div class="form-group">
						<div class="col-sm-2 control-label">段落标题</div>
						<div class="col-sm-10">
							<input type="text" class="form-control" v-model="infoDetail.title" placeholder="段落标题"/>
						</div>
					</div>
			       	<div class="form-group">
					   	<div class="col-sm-2 control-label">段落详细</div>
					   	<div class="col-sm-10">
					   		<textarea rows="3" class="form-control" v-model="infoDetail.detail" placeholder="段落详细"></textarea>
					    </div>
					</div>
						<div class="form-group">
					   	<div class="col-sm-2 control-label">显示顺序</div>
					   	<div class="col-sm-10">
					   		<input rows="3" class="form-control" v-model="infoDetail.displayOrder" placeholder="显示顺序" />
					    </div>
					</div>
			    </div>
			</div>
			
			<div class="form-group">
				<div class="col-sm-2 control-label"></div> 
				<input type="button" class="btn btn-info" v-on:click="addPart" value="添加段落" />
			</div>
			
			<div class="form-group">
				<div class="col-sm-2 control-label"></div> 
				<input type="button" class="btn btn-primary" v-on:click="saveOrUpdate" value="确定"/>
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" v-on:click="reload" value="返回"/>
			</div>
		</form>
	</div>
</div>

<!-- 选择菜单 -->
<div id="menuLayer" style="display: none;padding:10px;">
	<ul id="menuTree" class="ztree"></ul>
</div>

<script src="js/info.js"></script>

</body>
</html>